<!DOCTYPE html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>最新一百期开奖结果与统计</title>
    <script src="index.js"></script>
    <link rel="stylesheet" type="text/css" href="index1.css">
</head>
<body>
    <div class="title"><h1>期数列表</h1></div>
    <div><input type="button" value="刷新列表" onclick="fleshData()"></input>
    <input type="button" value="显示隐藏列表" onclick="showhidd()"></input></div>
    <hr/>
    <div id="display" style="display:none">
    <div id="list">
    <?php
    include("config.php");
    $sql1="select  *  from records";
    $result1=$mysqli->query($sql1);
    $sql="select * from (select  id,issueid,num  from records order by id desc LIMIT 0, 100) as b order by b.id";
    $result=$mysqli->query($sql);
    if($result1->num_rows){
    while($field=$result->fetch_object()){
        echo "<div class='list1'>";
        echo "第".$field->issueid."期，";
        echo "数字：".$field->num;
        echo "</div>";
    }
    }else{
        echo "没有数据";
    }
    $mysqli->close();
    ?>
    </div>
    </div>
    <hr/>
    <div class="cl">最新一期输入错误删除<input type="button" value="删除" onclick="delData()"></input>
    <div id="backdel"></div></div>
    <hr/>
    <div class="title"><h1>统计</h1></div>
    <hr/>
    <div id="showissue">
<?php
 include("config.php");
$sqls="select  *  from records";
$results=$mysqli->query($sqls);
$sqla="select  a.num,count(*) as ci from (select  id,num from records order by id desc LIMIT 0, 100) as a group by a.num";
$resulta=$mysqli->query($sqla);
if($results->num_rows){
while($field=$resulta->fetch_object()){
echo "<div class='issues'>";
echo "数字：".$field->num;
echo "，出现次数：".$field->ci;
echo "</div>";
}
}else{
    echo "没有数据";
}
$mysqli->close();
?>
    </div>
    <div><p>输入<input type="text" id="inissue"> </input>期，
    开出数字
     <input type="text" id="indata"> </input>
    <input type="button" value="保存" onclick="getData()"> </input></p></div>
    <div></div>
</body>
</html>